import '@/assets/styles/normalize.scss';
import '@/assets/styles/main.scss';
import '@/assets/styles/transition.scss';
import '@/assets/iconfont/iconfont.css';

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import '@/utils/permission';


const app = createApp(App)

app.use(createPinia())
app.use(ElementPlus, {
  locale: zhCn
})
app.use(router)
app.config.globalProperties.globalMessage = '全局信息'
app.mount('#app')
// 初始化项目主题色，所有颜色都在assets/styles/theme.scss中定义
// 通过修改document.documentElement.setAttribute('data-theme')切换
// 图片主题色
// document.documentElement.setAttribute('data-theme', 'default');
// 视频主题色
// document.documentElement.setAttribute('data-theme', 'video');
// 音频主题色
document.documentElement.setAttribute('data-theme', 'audio');

// 解决Uncaught ResizeObserver loop completed with undelivered notifications报错
window.ResizeObserver = class ResizeObserver extends window.ResizeObserver {
  constructor(callback) {
    super(entries => {
      // 使用requestAnimationFrame来延迟执行回调函数
      requestAnimationFrame(() => {
        callback(entries);
      });
    });
  }
}
